package cn.px.dao.mapper.purchase;

import cn.px.dao.config.MyMapper;
import cn.px.dao.dto.purchase.PurchaseListDTO;
import cn.px.dao.dto.purchase.PurchasePlanListDTO;
import cn.px.dao.entity.purchase.PurchasePlanList;
import cn.px.dao.vo.query.purchase.PurchasePlanListVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * @Description 采购计划明细 mapper
 * @author 品讯科技
 * @date 2024-08
 * @Version Copyright (c) 2020,北京乾元坤和科技有限公司 All rights reserved.
 */
@Component
public interface PurchasePlanListMapper extends MyMapper<PurchasePlanList> {
    /**
     * 分页查询
     *
     * @param dto
     * @return
     */
    List<PurchasePlanListVO> selectList(PurchasePlanListDTO dto);

    /**
     * @param dto
     */
    void updateSetNull(PurchaseListDTO dto);

    /**
     * 累加重量和体积
     *
     * @param dto
     * @return
     */
    PurchasePlanListVO selectSumWeightVolume(PurchasePlanListDTO dto);

    /**
     * 更新重量体积等
     *
     * @param dispatchOrderId
     */
    void updateSumWeightVolume(@Param("dispatchOrderId") String dispatchOrderId);

    /**
     * 更新已购数量
     *
     * @param purchasePlanId
     */
    void updateBoughtQuantity(@Param("purchasePlanId") String purchasePlanId);

    /**
     * 更新已到数量
     *
     * @param purchasePlanId
     */
    void updateArrivedQuantity(@Param("purchasePlanId") String purchasePlanId);

}
